<?php 
/**
  * 网站配置控制器
  * date 2013-1-17 
  */
class OptionsAction extends CommonAction {

	public function _initialize()
	{
    $this->currentModel = D(MODULE_NAME);    
		parent::_initialize();		
	}
    public function index()
    {
    	
    	if ($this->isPost())
    	{
		    $this->currentModel->addOptions($_POST);
			  $this->currentModel->makeCacheFile($this->currentModel->selectAllOptions(),MODULE_NAME);
			  $this->success('网站基本设置成功',U(MODULE_NAME.'/index'));
    	}else
    		{
		    	$this->assign('data',$this->currentModel->selectAllOptions());
    			$this->display('index');
    		}
    }
}	
 ?>